<template>
  <div class="header">
    <el-col :span="4"><div class="grid-content bg-purple-dark"></div></el-col>
    <el-col :span="8">
      <div class="grid-content bg-purple-dark">
        您好，欢迎光临LOVO商城！
        <!-- <a href="javascript:void(0)">[登录]</a>
        <a href="javascript:void(0)">[注册]</a> -->
      </div></el-col
    >

    <el-col :span="8" class="rightInfo">
      <div class="grid-content bg-purple-dark">
        <a href="javascript:void(0)" @click="toItems">商城首页</a>|
        <el-dropdown>
          <span class="el-dropdown-link" id="user">
            用户中心
          </span>

          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item icon="el-icon-user-solid" @click.native="toUser"
              >消费管理</el-dropdown-item
            >
            <el-dropdown-item
              icon="el-icon-user-solid"
              @click.native="toAddress"
              >收货地址</el-dropdown-item
            >
            <el-dropdown-item icon="el-icon-wallet" @click.native="toUserInfo"
              >个人资料</el-dropdown-item
            >
             <el-dropdown-item icon="el-icon-wallet" @click.native="toOrder"
              >个人订单</el-dropdown-item
            >
          </el-dropdown-menu> </el-dropdown
        >|<a href="javascript:void(0)">服务中心</a> |<a
          href="javascript:void(0)"
          @click="tocart"
          >购物车</a
        >|<a href="javascript:void(0)" @click="exit">注销</a>
      </div></el-col
    >
    <el-col :span="4"><div class="grid-content bg-purple-dark"></div></el-col>

    <div class="left"></div>
    <div class="right"></div>
  </div>
</template>

<script>
import { removeSession } from "../../service/user";
export default {
  components: {},
  data() {
    return {};
  },
  computed: {},
  methods: {
    tocart() {
      this.$router.push({ path: "/cart" });
    },
    toItems() {
      this.$router.push({ path: "/items" });
    },
    toUserInfo() {
      this.$router.push({ path: "/userInfo" });
    },
    toUser() {
      this.$router.push({ path: "/Balance" });
    },
    toOrder() {
      this.$router.push({ path: "/order" });
    },
    toAddress() {
      this.$router.push({ path: "/address" });
    },
    exit() {
      this.$confirm("确认是否安全退出?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          removeSession();
          this.$router.push({ path: "/login" });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消",
          });
        });
    },
    
  },
  
  mounted() {},
};
</script>

<style>
#user {
  color: #0000fa;
  font-weight: 545;
  font-size: 15px;
}
.grid-content {
  border-radius: 0px;
  min-height: 25px;
}
.header {
  flex-direction: column;
  width: 100%;
  height: 25px;
  border: yellowgreen 1px solid;
}
.rightInfo {
  text-align: right;
}
.el-row {
  margin-bottom: 20px;
  /* &:last-child {
    margin-bottom: 0;
  } */
}
.el-col {
  border-radius: 4px;
}
.bg-purple-dark {
  background: #99a9bf;
}
.bg-purple {
  background: #d3dce6;
}
.bg-purple-light {
  background: #e5e9f2;
}
.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}
</style>
